TouchPoints = class()

function TouchPoints:init()
    self.touches = {}
    xx = {}
    yy = {}
end

function TouchPoints:touched(touch)
    if touch.state == BEGAN then
        self.touches[touch.id] = touch
        
    end
end

function TouchPoints:draw()
    pushStyle()
    strokeWidth(3)
    for k,v in pairs(self.touches) do
        math.randomseed(v.id)
        fill(math.random(255),math.random(255),math.random(255))
        stroke(math.random(255),math.random(255),math.random(255))
        line(0,v.y,WIDTH,v.y)
        line(v.x,0,v.x,HEIGHT)
    end
    
    stroke(0, 0, 0, 255)
    fill(0, 0, 0, 255)
    line(0,CurrentTouch.y,WIDTH,CurrentTouch.y)
    line(CurrentTouch.x,0,CurrentTouch.x,HEIGHT)
    text("y:"..CurrentTouch.y,WIDTH-100,CurrentTouch.y+20)
    text("x:"..CurrentTouch.x,CurrentTouch.x-80,HEIGHT-20)
    
    stroke(255, 255, 255, 255)
    fill(255, 255, 255, 255)
    line(0,CurrentTouch.prevY,WIDTH,CurrentTouch.prevY)
    line(CurrentTouch.prevX,0,CurrentTouch.prevX,HEIGHT)
    text("prevY:"..CurrentTouch.prevY,WIDTH-100,CurrentTouch.prevY-20)
    text("prevX:"..CurrentTouch.prevX,CurrentTouch.prevX+20,HEIGHT-20)
    popStyle()
end
